added samples
[windows-sources.git] / sdk / samples / all in on code / Visual Studio 2008 / VBWPFAutoCompleteTextBox / MainWindow.xaml.vb
blob08bafa9fe3ef34e1e687bd741c50b86f4f3bea69
1 '****************************** Module Header ******************************'
2 ' Module Name: MainWindow.xaml.vb
3 ' Project: VBWPFAutoCompleteTextBox
4 ' Copyright (c) Microsoft Corporation.
5 '
6 ' This example demonstrates how to achieve AutoComplete TextBox in WPF
7 ' Application.
8 '
9 ' This source is subject to the Microsoft Public License.
10 ' See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
11 ' All other rights reserved.
13 ' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
14 ' EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
15 ' WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
16 '***************************************************************************'
19 ''' <summary>
20 ''' Interaction logic for MainWindow.xaml
21 ''' </summary>
22 Partial Public Class MainWindow
23 Inherits Window
24 ''' <summary>
25 ''' Initializes a new instance of the <see cref="MainWindow"/> class.
26 ''' </summary>
27 Public Sub New()
28 InitializeComponent()
29 ' set dataSource for AutoComplete TextBox
30 ConstructAutoCompletionSource()
31 End Sub
33 ''' <summary>
34 ''' Constructs the auto completion source.
35 ''' </summary>
36 Private Sub ConstructAutoCompletionSource()
38 Me.textBox.AutoSuggestionList.Add("Hello world")
39 Me.textBox.AutoSuggestionList.Add("Hey buddy")
40 Me.textBox.AutoSuggestionList.Add("Halo world")
41 Me.textBox.AutoSuggestionList.Add("apple")
42 Me.textBox.AutoSuggestionList.Add("apple tree")
43 Me.textBox.AutoSuggestionList.Add("appaaaaa")
44 Me.textBox.AutoSuggestionList.Add("arrange")
45 For i As Integer = 0 To 99
46 Me.textBox.AutoSuggestionList.Add("AA" & i)
47 Next
48 End Sub
49 End Class